import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.sql.SQLOutput;
import java.util.Scanner;

import static com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type.Int;

public class a {
    public static void main(String[] args) throws IOException {
    Scanner sc = new Scanner(System.in);
    int num =sc.nextInt();
    int sum=0;
    while(num!=0)
    {
        sum+=num%10;
        num/=10;
    }
    System.out.println(sum);

    BufferedReader buf;
    String a;
    buf=new BufferedReader(new InputStreamReader(System.in));
        System.out.print("请输入你想说的话");
        a=buf.readLine();
        System.out.println(a);
        float b =Float.parseFloat(a);
        System.out.println(b);
        char ddd=(char)System.in.read();
        System.out.println(ddd);

}
}





